id/email
password
forgot password | create account
about | help | prefs
ReadingBatcode reading practice

 

 

String OperationsSubstr5

prev  |  next  |  chance

A slice is inclusive of the starting index and exclusive of the ending index.

public static String slice(String s) {
    return s.substring(2, 5);
}
Function Call  Return Value
slice("Garage")
slice("Track")
slice("556843")
slice("Elephant")
slice("Violets")

Experiment with this code on Gitpod.io

⬅ Back